package cn.genmer.record.common;

/**
 * Result枚举类
 *
 * @author yyq
 * @date 2020-11-30
 */
public enum ResultCode implements ErrorCode {
    SUCCESS(20000, "操作成功"),
    FAILED(5000, "操作失败"),
    TOKEN_IS_INVALID(401, "token无效"),
    TOKEN_EXPIR(402, "token已经过期"),
    FORBIDDEN(403, "没有相关权限"),
    TOKEN_ALGORITHM(405, "token算法不一致"),
    UNABLE_GET_FROM_TOKEN(406, "无法从token获取用户信息"),
    REGISTRATION_FAIL(10001, "注册失败"),
    LOGON_FAILURE(40001, "登陆失败"),
    SERVER_IS_BUSY(30000, "用户登陆状态失效，请尝试重新登陆"),
    USER_NOT_FOUND(404, "未找到该用户"),
    USER_NOT_LOGIN(407, "用户未登录"),
    USER_USERORPASS_ERROR(408, "用户名密码错误"),
    USER_IS_FORZE(409, "账户已被禁用");


    private Integer code;
    private String message;

    ResultCode(Integer code, String msg) {
        this.code = code;
        this.message = msg;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}